

import 'package:flutter/material.dart';


class CustomDialog {

  static Future<void> showListDialog(BuildContext context,String str) {
    return showDialog(
      context: context,
      barrierDismissible: false,
      builder: (BuildContext context) {
        var child = Row(
            mainAxisSize: MainAxisSize.min,
            mainAxisAlignment: MainAxisAlignment.center,
            children:[
              Padding(
                padding: const EdgeInsets.all(18.0),
                child: CircularProgressIndicator(
                  valueColor: AlwaysStoppedAnimation(Colors.blue),
                ),
              ),
              Text(str, style: TextStyle(
                      inherit: false,
                      color: Colors.black,
                      fontSize: 18
                  )
              ),
            ]);
        return WillPopScope(
            onWillPop: () async => false,//关键代码
            child: Dialog(child: child)
        );
      },
    );
  }
}
